package com.blog.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.blog.dao.TestDAO;
import com.blog.domain.IbatisTest;


public class TestService {

	private TestDAO testDAO;
	public void setTestDAO(TestDAO testDAO){
		this.testDAO = testDAO;
	}
	
	@Transactional
	public void insertAll(IbatisTest dto){
		int max = testDAO.selectMCodeMax();
		dto.setmCode(max);
		testDAO.insertAll(dto);
	}
	
	@Transactional(readOnly=true)
	public List<String> selectAll(){
		List<String> list = testDAO.selectAll();
		return list;
	}
}
